package com.lcxw.hxzbapi.controller.roomcontroller;

import org.springframework.stereotype.Component;
import com.lcxw.hxzbcommon.common.qiniu.Client;
import com.lcxw.hxzbcommon.common.qiniu.RoomConfig;
import com.lcxw.hxzbcommon.common.qiniu.Hub;
import com.lcxw.hxzbcommon.common.qiniu.PiliException;

@Component
public class Qiniu {

    private Client cli = new Client(RoomConfig.ACCESS_KEY, RoomConfig.SECRET_KEY);

    Hub hub = cli.newHub(RoomConfig.HUB);

    public Hub getHub(){

       return this.hub;

    }

    public String getLiveStatus(long roomId) throws PiliException {
       return hub.get(roomId+"").liveStatus().toJson();
    }

}
